package com.rainbow.common

class RespBean {

    var status: Int? = null

    var msg: String? = null

    var obj: Any? = null


    companion object {
        fun build(): RespBean {
            return RespBean()
        }

        fun ok(msg: String): RespBean {
            return RespBean(200, msg, null)
        }

        fun ok(msg: String, obj: Any?): RespBean {
            return RespBean(200, msg, obj)
        }

        fun error(msg: String, obj: Any?): RespBean {
            return RespBean(500, msg, obj)
        }

        fun error(msg: String): RespBean {
            return RespBean(500, msg, null)
        }
    }

    // 构造函数
    constructor()

    constructor(status: Int, msg: String, obj: Any?) {
        this.msg = msg
        this.status = status
        this.obj = obj
    }


}